/**
 * ChronoTests
 *
 * @author Chris Pratt
 *
 * 9/1/2006
 */
package com.anodyzed.onyx.util;

import java.util.Calendar;
import java.util.GregorianCalendar;

import static org.junit.Assert.*;
import org.junit.Test;

public class ChronoTests {

  /**
   * Perform a jUnit Test on the Misc test(Date) routine
   */
  @Test public void testClearTo () {
    Calendar cal = new GregorianCalendar(1964,Calendar.OCTOBER,10,06,20,42);
    assertEquals("Clear To Second Failed",new GregorianCalendar(1964,Calendar.OCTOBER,10,06,20,42),Chrono.clearTo(cal,Calendar.SECOND));
    assertEquals("Clear To Minute Failed",new GregorianCalendar(1964,Calendar.OCTOBER,10,06,20,0),Chrono.clearTo(cal,Calendar.MINUTE));
    assertEquals("Clear To Hour Failed",new GregorianCalendar(1964,Calendar.OCTOBER,10,06,0,0),Chrono.clearTo(cal,Calendar.HOUR));
    assertEquals("Clear To Day Failed",new GregorianCalendar(1964,Calendar.OCTOBER,10,0,0,0),Chrono.clearTo(cal,Calendar.DATE));
    assertEquals("Clear To Month Failed",new GregorianCalendar(1964,Calendar.OCTOBER,1,0,0,0),Chrono.clearTo(cal,Calendar.MONTH));
    assertEquals("Clear To Year Failed",new GregorianCalendar(1964,Calendar.JANUARY,1,0,0,0),Chrono.clearTo(cal,Calendar.YEAR));
    assertEquals("Clear To Era Failed",new GregorianCalendar(0,Calendar.JANUARY,1,0,0,0),Chrono.clearTo(cal,Calendar.ERA));
  } //testClearTo
  
} //*ChronoTests
